using System;
using Glade;
using Gtk;

namespace DreamPark
{
	public class Screen_DeposerVehicule
	{
		private ControleurEntree ctrlEntree;
		private TypeVehicule type;
		private int acces;
		
		public Screen_DeposerVehicule (TypeVehicule type, int acces, ControleurEntree ctrlEntree)
		{
			Glade.XML gxml = new Glade.XML (null, "DreamPark.FenetreDeposerVehicule.glade", "FenetreDeposerVehicule", null);                    
            gxml.Autoconnect (this);
			
			this.ctrlEntree = ctrlEntree;
			this.type = type;
			this.acces = acces;
			
			Vehicule vehicule = ctrlEntree.GetVehicule(type, acces);
			
			LabelValeurImmatriculation.Text = vehicule.Immatriculation;
			LabelValeurHauteur.Text = vehicule.Hauteur.ToString();
			LabelValeurLongueur.Text = vehicule.Longueur.ToString();
		}
		
		[Glade.Widget]
		Dialog FenetreDeposerVehicule;
		
		[Glade.Widget]
		Label LabelValeurImmatriculation;
		
		[Glade.Widget]
		Label LabelValeurHauteur;
		
		[Glade.Widget]
		Label LabelValeurLongueur;
		
		
		public void BoutonValidationOK_clicked_cb(System.Object obj, EventArgs e) {
			
			Ticket ticket = ctrlEntree.GarerVehicule(acces, type);
			Screen_ImpressionTicket fenetreImpressionTicket = new Screen_ImpressionTicket(ctrlEntree, ticket, acces);
			FenetreDeposerVehicule.Destroy();
		}
		
		public void BoutonValidationNOK_clicked_cb(System.Object obj, EventArgs e) {
			FenetreDeposerVehicule.Destroy();
		}
	}
}

